home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Info 1994 March
/
Internet Info CD-ROM (Walnut Creek) (March 1994).iso
/
networking
/
info-service
/
wais
/
ir-book-sources
/
mphf
/
rantab.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-04-08
|
1KB
|
41 lines
/****************************** rantab.c **********************************
Purpose: Routines for handling the random number tables.
Provenance: Written and tested by Q. Chen and E. Fox, March 1991.
Edited and tested by S. Wartik, April 1991.
Notes: None.
**/
#include "types.h"
#include "pmrandom.h"
#include "rantab.h"
/*************************************************************************
initialize_randomTable( randomTablesType, int )
Return: void
Purpose: Initialize the three random number tables and return the seed
used.
**/
void initialize_randomTable( tables, seed )
randomTablesType tables; /* out: Tables of random numbers. */
int *seed; /* out: seed used to initialize tables. */
{
int i, j, k; /* Iterators over the tables. */
*seed = getseed();
setseed( *seed );
for ( i = 0; i < NO_TABLES; i++ ) /* Initialize the tables. */
for ( j = 0; j < ROWS; j++ )
for ( k = 0; k < COLUMNS; k++ )
tables[i][j][k] = pmrandom();
}